package com.hjl.controller;

import com.hjl.entity.User;
import org.apache.log4j.Logger;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.Map;

@Controller
//控制器:IndexController
public class IndexController3 {

    private Logger logger = Logger.getLogger(IndexController3.class);

    @RequestMapping("/index3")
    public String index(String username, Map<String,Object>model) {
        logger.info("hello,SpringMVC! username：" + username);
        model.put("username",username);
        return "index3";
    }


/*    public String index(@RequestParam(value = "username",required = false)String username) {
        logger.info("学框架就学Spring MVC!" + username);
        return "index2";
    }*/

/*    @Override
    protected ModelAndView handleRequestInternal(HttpServletRequest arg0,HttpServletResponse arg1) throws Exception {

        System.out.println("学框架就学Spring MVC!");
        return new ModelAndView("index2");
    }*/
}

